package com.tchyy.provider.data

import android.os.Parcel
import android.os.Parcelable

/**
 * @author: pujialin
 * @date: 2020-10-14 10:37
 * @desc: 服务端返回的银行数据
 */
class BindBankInfo() : Parcelable{
    //用户 id
    var applyUserId: Long? = null
    //支户行名称
    var bankBranchName: String? = null
    //银行卡
    var bankCard: String? = null
    //银行卡绑定主键
    var bankCardBindingId: Long? = null
    //开户行名称
    var bankName: String? = null
    //预留手机号
    var reservedCall: String? = null
    //银行卡 url
    var icon: String? = null
    //验证码
    var smsCode: String? = null
    var code: String? = null
    var background: String? = null
    //2表示被选中的
    var mark: Int? = null

    constructor(parcel: Parcel) : this() {
        applyUserId = parcel.readValue(Long::class.java.classLoader) as? Long
        bankBranchName = parcel.readString()
        bankCard = parcel.readString()
        bankCardBindingId = parcel.readValue(Long::class.java.classLoader) as? Long
        bankName = parcel.readString()
        reservedCall = parcel.readString()
        icon = parcel.readString()
        smsCode = parcel.readString()
        code = parcel.readString()
        background = parcel.readString()
        mark = parcel.readValue(Int::class.java.classLoader) as? Int
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeValue(applyUserId)
        parcel.writeString(bankBranchName)
        parcel.writeString(bankCard)
        parcel.writeValue(bankCardBindingId)
        parcel.writeString(bankName)
        parcel.writeString(reservedCall)
        parcel.writeString(icon)
        parcel.writeString(smsCode)
        parcel.writeString(code)
        parcel.writeString(background)
        parcel.writeValue(mark)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<BindBankInfo> {
        override fun createFromParcel(parcel: Parcel): BindBankInfo {
            return BindBankInfo(parcel)
        }

        override fun newArray(size: Int): Array<BindBankInfo?> {
            return arrayOfNulls(size)
        }
    }

}